package org.learn.intermediate.homework;

public class HomeWork02 {
    public static void main(String[] args) {
        Professor professor = new Professor("李强", 45, "高级职称", 28999, "1.3");
        professor.introduce();

    }
}
class Teacher{
    private String name = null;
    private int age = 0;
    private String post = " ";
    private double salary = 0;

    public Teacher(String name, int age, String post, double salary) {
        this.name = name;
        this.age = age;
        this.post = post;
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getPost() {
        return post;
    }

    public void setPost(String post) {
        this.post = post;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }
    public void introduce(){
        System.out.print(this.getName() +"\n"  + this.getAge() + "\n" + this.getPost() + "\n" + this.getSalary() + "\n");
    }

}
class Professor extends Teacher{
    private String grade = null;

    public Professor(String name, int age, String post, double salary, String grade) {
        super(name, age, post, salary);
        this.grade = grade;
    }

    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }
    public void introduce(){
        System.out.println("这是教授的信息");
        super.introduce();
        System.out.print(grade);
    }
}